<?php
// <copyright file="AuthenticationType.cs" company="NQtec">
// Copyright (c) 2008, 2009 All Right Reserved, http://www.dqer.com/
// Copyright (c) 2008, 2009 All Right Reserved, http://www.nqtec.com/
//
// This source is part of the DQER library that released under the LGPL.
// Please see the License.txt file for more information.
// All other rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// </copyright>
// <author>Victor Gatkov</author>
// <email>v.gatkov@nqtec.com</email>
// <email>info@dqer.com</email>
// <date>2008-09-11</date>
// <summary>Contains a base, abstract class for an AuthorisationPolicyProvider</summary>

class Render {

function page_open () {
   global $mod;
   $mod->lx('html');
   echo "<head>\r";
   $mod->lx('head');
   echo "</head>\r";
   echo "<body>\r";
   $mod->lx('body');
   echo " <div id=\"header\"><!-- Header -->\r";
   $mod->lx('header');
   echo " </div><!-- End of Header -->\r\r";
   echo " <div id=\"cent\"><!-- cent column -->\r";
}

function page_close () {
   global $mod;
   echo " </div><!-- end of cent column -->\r\r";
   echo " <div id=\"footer\"><!-- footer -->\r";
   $mod->lx('footer');
   echo " </div><!-- end of footer -->\r";
   echo "</body>\r</html>\r";
}

// ---------------------------------------------------------------------------------------------------------------------------
function render_err_box($subj, $body) {
   echo "      <p>&nbsp;</p>\r";
   echo "      <div class=\"errbox\">\r";
   echo "               <h5>$subj</h5>\r";
   echo "                 <p>&nbsp;</p>\r";
   echo "               $body\r";
   echo "               <p>&nbsp;</p><br />\r";
   echo "               <h5><a href=\"?pg=home\">Home Page</a></h5>\r";
   echo "      </div>\r";
// ADMIN NOTIFICATION !!! or log
}

function flash($file,$img,$width,$height) {
   $alt = "flash-image";
   echo "   <object type=\"application/x-shockwave-flash\" data=\"".$file.".swf\" width=\"$width\" height=\"$height\">\r";
   echo "      <param name=\"movie\" value=\"".$file.".swf\" />\r";
   echo "      <img src=\"".$file.".jpg\" width=\"$width\" height=\"$height\" alt=\"".$alt."\" />\r";
   echo "   </object>\r";
}

// ---------------------------------------------------------------------------------------------------------------------------

function image($path,$filename,$ext) {
 echo "   <img src=\"".$path."/".$filename.".".$ext."\" alt=\"$filename\" title=\"$filename\" />\n";
}

function img($class='',$path,$filename,$ext,$info='') {
 echo "   <img ";
 if ($class!='') echo "class=\"$class\" ";
 echo "src=\"".$path."/".$filename.".".$ext."\" ";
 if ($info=='') $info = $filename;
 echo "alt=\"$info\" title=\"$info\" ";
 echo " />\n";
}

function center_open() {
 echo "\n   <div class=\"cnt\"><!-- align center -->\n";
}

function center_close() {
 echo "\n   </div><!-- End of align center -->\n\n";
}

function link($link, $desc) {
 echo "   <a href=\"".$link."\">".$desc."</a>\n";
}
function link_open($link) {
 echo "   <a href=\"".$link."\">\n";
}
function link_close() {
 echo "   </a>\n";
}

function h1($text) {
 echo "   <h1>".$text."</h1>\n";
}
function h2($text) {
 echo "   <h2>".$text."</h2>\n";
}
function h3($text) {
 echo "   <h3>&nbsp;&nbsp;&nbsp;".$text."</h3>\n";
}
function h4($text) {
 echo "   <h4>".$text."</h4>\n";
}

function p($text,$class='') {
 if ($class=='') { 
     echo "   <p>".$text."</p>\n"; 
 } else {
     echo "   <p class=\"".$class."\">".$text."</p>\n"; 
 }
}
function b($text) {
 echo "   <b>".$text."</b>\n";
}
function n($text) {
 echo "   <span>".$text."</span>\n";
}

function tbl_open($pp) {
 echo "   <table ".$pp.">\n";
}
function tbl_tr_on($class='') {
 if ($class=='') { 
     echo "   <tr>\n"; 
 } else {
     echo "   <tr class=\"$class\">\n"; 
 }
}
function tbl_td_on($tt) {
 echo "   <td ".$tt.">\n";
}
function tbl_td_next($tt) {
 echo "   </td><td ".$tt.">\n";
}
function tbl_td_off() {
 echo "   </td>\n";
}
function tbl_tr_off() {
 echo "   </tr>\n";
}
function tbl_close() {
 echo "   </table>\n";
}


function lst_open() {
 echo "   <ul>\n";
}
function lst($lst) {
 echo "      <li>".$lst."</li>\n";
}
function lst_close() {
 echo "   </ul>\n";
}
function br($nn) {
 for ($i=0;$i<$nn;$i++) { echo "<br />"; }
 echo "\n";
}
function sp($nn) {
 for ($i=0;$i<$nn;$i++) { echo "&nbsp;"; }
 echo "\n";
}
function rem($rr) {
 echo "<!-- ".$rr." -->\n";
}

function col_open() {
 echo " <div class=\"col\"><!-- Column -->\n";
}
function col_close() {
 echo " </div><!-- End of Column -->\n";
}

function clr() {
 echo " <div class=\"clr\"></div><!-- clear -->\n";
}


};

?>
